package com.example.jiagoujiexiang.Mapper;

import com.example.jiagoujiexiang.entity.User;
import com.example.jiagoujiexiang.entity.subscribe;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface adminDao {
    @Select("select * from user")
    public List<User> getUserList();

    @Select("select * from subscribe s join pet_store.user u on u.id = s.user_id join pet_store.cats pc on s.pet_id = pc.query_number")
    public List<subscribe> getdogsSubscribeList();

    @Select("select * from subscribe s join pet_store.user u on u.id = s.user_id join pet_store.dogs pc on s.pet_id = pc.query_number")
    public List<subscribe> getcatsSubscribeList();
}
